/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.protocol.passive;

import info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol;
import info.peigen.hotpot.component.gateway.dianlan.facade.enums.DianlanTransResultSign;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BCD;
import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.ENUM;

/**
 * <b>(DianlanTransInformationResponse)</b>
 * <p>
 * 交易记录-应答
 * <p>
 * 运营平台接收到结算账单上传后，都需回复此确认信息。若桩未收到回复帧，则 5 分钟后继续
 * 上送一次交易记录，此情况下无论平台是否成功回复都停止上送。这一帧仅是报文交互使用，意
 * 指平台成功接收到交易记录报文，并不代表交易订单成功结算
 * 帧类型码 0x40
 * 序列号域 0002
 * 数据长度 15(21)
 * 帧校验域 48B1
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/8/11
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class DianlanTransInformationResponse {
    /** 交易流水号 */
    @DianlanProtocol(length = 16, start = 0, end = 16, dataType = BCD)
    String                 transNo;
    /** 确认结果 */
    @DianlanProtocol(length = 1, start = 16, end = 17, dataType = ENUM)
    DianlanTransResultSign authSign;
}